<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">{{ num }}
       <!-- pointme就是点击事件的处理函数 -->
       <button v-on:click="pointme(this)">点击我</button>
       <button @click="pointme3">点击我</button>
       <button v-on:click="add(1,$event)" >加</button>
    </div>
  </body>
</html>
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<script> 
 
  const app = Vue.createApp({    
    data() { //  定义对象的属性
      return {
        msg: "hello",
        num:0       
      };
    },
    methods: {
      add(value,event) {
                this.num += value;
                console.log(event);
                console.log(event.target);
            },
      pointme(obj){
        console.log("1");
        console.log(obj);

      },
      pointme1(){},
     
    },
  });
  app.mount("#app");
</script>
